﻿#include "TestPlayerController.h"

#include "TestCharacter.h"

ATestPlayerController::ATestPlayerController()
{
}

void ATestPlayerController::SetPawn(APawn* InPawn)
{
	Super::SetPawn(InPawn);

	
	// ASC初始化的逻辑放在这里更好，逻辑更统一，服务器、客户端就不用分开写了
	if (const ATestCharacterBase* TestCharacterBase = Cast<ATestCharacterBase>(InPawn))
	{
		if (UAbilitySystemComponent* AbilitySystemComponent = TestCharacterBase->GetAbilitySystemComponent())
		{
			AbilitySystemComponent->InitAbilityActorInfo(InPawn, InPawn);
		}
	}
}
